package com.yjha.lzmarathonsys.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yjha.lzmarathonsys.bean.TbComment;
import com.yjha.lzmarathonsys.bean.TbPersonClockin;
import com.yjha.lzmarathonsys.bean.TbSpecialClockin;
import com.yjha.lzmarathonsys.service.TbCommentService;
import com.yjha.lzmarathonsys.service.TbPersonClockinService;
import com.yjha.lzmarathonsys.service.TbSpecialClockinService;
import com.yjha.lzmarathonsys.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@CrossOrigin
@RestController
@Api(value = "后台菜单消息提示",tags = "后台菜单消息提示")
public class IndexController {
    @Autowired
    private TbCommentService tbCommentService;

    @Autowired
    private TbSpecialClockinService tbSpecialClockinService;

    @Autowired
    private TbPersonClockinService tbPersonClockinService;



    @GetMapping("/getAuditCounts")
    @ApiOperation("获取审核统计数")
    public R getAuditCounts(){
        long comment = tbCommentService.count(new QueryWrapper<TbComment>().eq("tb_target_status", 0));
        long special = tbSpecialClockinService.count(new QueryWrapper<TbSpecialClockin>().eq("tb_status", 2));
        long personal = tbPersonClockinService.count(new QueryWrapper<TbPersonClockin>().eq("tb_status", 2));
        return R.ok().put("comment", comment).put("special", special).put("personal", personal);
    }
}
